import request from '@/utils/request'

// 获取 - 权限点列表
export const getPermission = () => {
  return request({
    method: 'GET',
    url: '/sys/permission'
  })
}
// // 删除权限点
// 删除-权限点
// DELETE/sys/permission/{id}
export const delPermission = id => {
  return request({
    method: 'delete',
    url: `/sys/permission/${id}`
  })
}

// 新增-权限点
export const addPermission = data => {
  return request({
    method: 'POST',
    url: '/sys/permission',
    data
  })
}
// 获取-权限点详情
// GET/sys/permission/{id}
export const getUserPermission = id => {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`
  })
}
// 修改-权限点详情
export const editPermission = data => {
  return request({
    method: 'PUT',
    url: `/sys/permission/${data.id}`,
    data
  })
}
